package com.yanzhu.service.impl;

import com.yanzhu.service.MessageService;
import com.yanzhu.service.mapper.MessageMapper;
import com.yanzhu.service.model.Message;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 方炎柱
 * @Description:
 * @Date: Created in 10:52 2018/2/2
 * @Modified:
 */
@AllArgsConstructor
@Service
public class MessageServiceImpl implements MessageService {
    private MessageMapper messageMapper;

    @Override
    public int insert(Message message) {
        return messageMapper.insert(message);
    }

    @Override
    public List<Message> queryMessageList(long uid, int page, int size) {
        int begin = (page - 1) * size;
        return messageMapper.queryMessageList(uid, begin, size);
    }
}
